package com.lesent.model.exception;

import com.lesent.model.enums.RestException;

import java.io.Serializable;

/**
 * @author shengtao
 * @Description: 自定义异常
 * @date 2018/08/15 13:06
 */
public class KafkaException extends RuntimeException implements Serializable{

    private static final long serialVersionUID = 9195776405859136519L;
    /* 错误码 */
    private int code;

    public KafkaException(String message) {
        super(message);
    }

    public KafkaException(String message, int code) {
        super(message);
        this.code = code;
    }

    public KafkaException(RestException restException) {
        super(restException.getMsg());
        this.code = restException.getCode();
    }
}
